package oppo;

/**
 * @author Hang
 * @date 2022/9/2
 * @project AutumnOffer
 * @description
 **/
public class Solution3 {
    public static void main(String[] args) {
        int n = 4;
        System.out.println(tourismRoutePlanning(n));
    }
    public static long tourismRoutePlanning (int scenicspot) {
        // write code here
        long[] dp = new long[scenicspot+1];
        if(scenicspot==1){
            return 1;
        }
        if(scenicspot==2){
            return  2;
        }
        dp[1]=1;
        dp[2]=2;
        for(int i=3;i<=scenicspot;i++){
            dp[i] = dp[i-1]+dp[i-2];
        }
        return dp[scenicspot];
    }
}
